<?php

abstract class Backend_Utils_User 
{
    
    /**
    * Return logged backend user role
    * 
    * @return integer
    */
    static public function getRole($subject_id) 
    {
        $query = '
            SELECT 
                   `role` 
              FROM 
                   `system_admin` 
             WHERE 
                   `subject_id` = ' . (int)$subject_id;
        return database::fetchOne($query);
    }
    
    /**
    * Return list of available backend roles.
    * 
    */
    static public function getRoles() 
    {
        $query = '
            SELECT 
                   `id`, 
                   `role` 
              FROM 
                   `system_strategy` 
          ORDER BY 
                   `id` ASC
            ';
        return database::fetchPairs($query);
    }
    
}